package com.day19.Copy;

import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

public class CopyFileDemo03 {
    public static void main(String[] args) {
    }
        private static void method4()throws IOException{
            FileReader fr=new FileReader("fr.txt");
            FileWriter fw=new FileWriter("fw.txt");
            try(fr;fw){
                char[] chars=new char[1024];
                int len;
                while((len=fr.read(chars))!=-1){
                    fw.write(chars,0,len);
                }
            }catch (IOException e){
                e.printStackTrace();
            }
        }
    }

